﻿using System.Collections.ObjectModel;

namespace AppDesigner.XamlDom
{
    public interface IXamlErrorService
    {
        //Report the xaml laod error
        void ReportError(string message, int line, int column);
    }

    public class XamlErrorService : IXamlErrorService
    {
        private ObservableCollection<XamlError> _errors = new ObservableCollection<XamlError>();

        public ObservableCollection<XamlError> Errors
        {
            get { return _errors; }
            set { _errors = value; }
        }

        public void ReportError(string message, int line, int column)
        {
            _errors.Add(new XamlError { Message = message, Line = line, Column = column });
        }
    }

    public class XamlError 
    {
        public string Message { get; set; }
        public int Line { get; set; }
        public int Column { get; set; }
    }
}
